﻿<%@ Page Language="C#" MasterPageFile="~/GUIMaster.Master" AutoEventWireup="true" CodeBehind="Home.aspx.cs"
    Inherits="TripLOA.GUI.secure.Home" Culture="Auto" meta:resourcekey="Page"
    UICulture="Auto" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>




<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">  

<script type="text/javascript">

function showFields()
{
 var div = document.getElementById('fields_details');
 div.style.visibility = "visible";
 
}

function hideFields()
{
 var div = document.getElementById('fields_details');
 div.style.visibility= "hidden";
}


</script>
 
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentHomePage" runat="server">
    <h1>
    <asp:LoginView ID="LoginView2" runat="server">
                <LoggedInTemplate>
                    <asp:Label ID="lblWelcome" runat="server" Text="Benvenuto in tripLOA" 
                        meta:resourcekey="lblWelcomeResource"></asp:Label>
                    <asp:LoginName ID="LoginName" runat="server" 
                        meta:resourcekey="LoginName2Resource" />
                </LoggedInTemplate>
                
         </asp:LoginView>    
    </h1>
    
    <div id="content_home_log">
        
        
        <div id="panel_controls_header"></div>
        <asp:Panel ID="there_are_notifications" runat="server" Visible="false">
        <div class="panel_controls_line">
        
        <div id="ico_alert_notification">
        <cc1:Accordion ID="Accordion1" runat="Server" SelectedIndex="1" HeaderCssClass="accordionHeader"
                    HeaderSelectedCssClass="accordionHeaderSelected" ContentCssClass="accordionContent"
                    AutoSize="None" FadeTransitions="true" TransitionDuration="250" FramesPerSecond="40"
                    RequireOpenedPane="false" SuppressHeaderPostbacks="true">
                   
                   
                   <Panes>
                        
                        <cc1:AccordionPane ID="panel1" HeaderCssClass="accordionHeader" runat="Server"
                            HeaderSelectedCssClass="accordionHeaderSelected" ContentCssClass="accordionContent" Visible="False">
                            
                            <Header>
                            <div class="alert_notifications">
                                <asp:label ID="lbl_msg_friend_request"  CssClass="label_title" runat="server" meta:resourcekey="lbl_msg_friend_request"></asp:label>
                                <asp:Label ID="lbl_count_friend_request" CssClass="label_title" runat="server"></asp:Label>
                                <asp:label ID="lbl_friend_request"  CssClass="label_title" runat="server" meta:resourcekey="lbl_friend_request"></asp:label>
                            </div>
                            </Header>
                            <Content>
                                
                                <div class="content_not">
                                <asp:GridView DataKeyNames="AskingUserID, RecipientID" GridLines="None" BorderStyle="none" ID="gv_friend_request" runat="server" OnRowCommand="AcceptOrDenyFriend" AutoGenerateColumns="false">
                                    <Columns>
                                    
                                    <asp:TemplateField ItemStyle-Width="20%">
                                    <ItemTemplate>
                                    <asp:HyperLink NavigateUrl='<%#"~/secure/userProfile.aspx?Nick=" + getUserName(""+Eval("AskingUserID"))%>' runat="server"><%# getUserName(""+Eval("AskingUserID"))%></asp:HyperLink>
                                    </ItemTemplate>
                                    </asp:TemplateField>
                                                           
                                    <asp:ButtonField ButtonType="Button" ControlStyle-CssClass="button_generics" ItemStyle-HorizontalAlign="Right" CommandName="Accept" meta:resourcekey="btnAccept" />
                                    <asp:ButtonField ButtonType="Button" ControlStyle-CssClass="button_generics" ItemStyle-HorizontalAlign="Left" CommandName="Deny" meta:resourcekey="btnDeny" />
                                                                       
                                    </Columns>
                                 
                                </asp:GridView>
                                </div>
                            </Content>
                            
                        </cc1:AccordionPane>
                          </Panes>
                          

        
                    <Panes>
               
                    
                        <cc1:AccordionPane ID="panel_friendship_notifications" HeaderCssClass="accordionHeader" runat="Server"
                            HeaderSelectedCssClass="accordionHeaderSelected" ContentCssClass="accordionContent" Visible="false">
                            <Header>
                            <div class="alert_notifications">
                                <asp:label ID="lbl_friendship_notifications"  CssClass="label_title" runat="server" meta:resourcekey="lbl_friendship_notifications"></asp:label>
                            </div>
                            </Header>
                            <Content>
                                
                                <div class="content_not">
                                <asp:GridView DataKeyNames="NewFriendID, RecipientID" GridLines="None" BorderStyle="none" ID="gv_friendship_notifications" runat="server" AutoGenerateColumns="false" OnRowCommand="VisitNewFriend">
                                    <Columns>
                                    
                                    <asp:TemplateField>
                                    <ItemTemplate>
                                    <asp:Label runat="server" Width="30%"><%# getUserName(""+Eval("NewFriendID"))%></asp:Label>
                                    </ItemTemplate>
                                    </asp:TemplateField>
                                                         
                                    <asp:ButtonField ButtonType="Button" ControlStyle-CssClass="button_generics" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Right" meta:resourcekey="btnVisit" />
                                        
                                    </Columns>
                                 
                                </asp:GridView>
                                </div>
                            </Content>
                            
                        </cc1:AccordionPane>
                          </Panes>

                    <Panes>
                        <cc1:AccordionPane ID="panel_notications" HeaderCssClass="accordionHeader" runat="Server"
                            HeaderSelectedCssClass="accordionHeaderSelected" ContentCssClass="accordionContent" Visible="false">
                            <Header>
                            <div class="alert_notifications">
                                <asp:label ID="lbl_msg_notify"  CssClass="label_title" runat="server" meta:resourcekey="lbl_msg_notify"></asp:label>
                                <asp:Label ID="count_notifications" CssClass="label_title" runat="server"></asp:Label>
                                <asp:label ID="lbl_notify"  CssClass="label_title" runat="server" meta:resourcekey="lbl_notify"></asp:label>
                            </div>
                            </Header>
                            <Content>
                               <div class="content_not">
                                
                                <asp:GridView DataKeyNames="TemplateType, TripId, senderID, id, UserId" GridLines="None" BorderStyle="none" OnSelectedIndexChanging="SelectNotification" ID="list_link" runat="server" AutoGenerateColumns="false">
                                    <Columns>
                                        <asp:TemplateField ItemStyle-CssClass="Item_table_departure" ItemStyle-Width="70%">
                                            <ItemTemplate>
                                                <asp:Label id="lbl1" runat="server" > <%# "" + getNotificationType(""+Eval("TemplateType"))%></asp:Label>
                                                <asp:Label ID="lblFromUser" runat="server" meta:resourcekey="lblFromUser"></asp:Label>
                                                <asp:HyperLink ID="HyperLink1" NavigateUrl='<%# "~/secure/userProfile.aspx?Nick=" + getUserName(""+Eval("senderID"))%>' runat="server"><%# getUserName(""+Eval("senderID"))%></asp:HyperLink>
                                                 
                                                <cc1:HoverMenuExtender ID="MyHME" runat="Server" TargetControlID="lbl1" PopupControlID="PopupMenu"
                                                    HoverCssClass="popupHover" PopupPosition="Left" OffsetX="0" OffsetY="0" PopDelay="50">
                                                </cc1:HoverMenuExtender>
                                            
                                                <asp:Panel ID="PopupMenu" runat="server">
                                                 <div class="popup_notifications">
                                                    <asp:Label ID="lbl_popup" runat="server" Text='<%# getFieldValue(""+Eval("id"))%>'></asp:Label>
                                                 </div>
                                                </asp:Panel>
                                                
                                            </ItemTemplate>
                                       </asp:TemplateField>
                                    
                                    <asp:CommandField ControlStyle-CssClass="button_generics" ButtonType="Button" SelectText="details" ShowSelectButton="true"/>
                                   
                                    </Columns>
                                 
                            </asp:GridView>
                            </div>
                            </Content>
                            
                        </cc1:AccordionPane>
                      </Panes>
                </cc1:Accordion>
        </div>
        </div>
        <div class="panel_controls_separator"></div>      
        </asp:Panel>
        <div class="panel_controls_line_buttons">
        
        <div id="img_menu">
            <asp:ImageButton ID="bt_profile" ImageUrl="~/master/resourcesNew/img/user_det.png" runat="server" PostBackUrl="~/secure/userProfile.aspx" meta:resourcekey="imgbtnUserProfile" />
            <asp:ImageButton ID="bt_newtrip" ImageUrl="~/master/resourcesNew/img/new_trip.png" PostBackUrl="~/secure/createNewTrip.aspx" meta:resourcekey="imgbtnNewTrip" runat="server" />
            <asp:ImageButton ID="bt_detTrip" ImageUrl="~/master/resourcesNew/img/det_trip.png" PostBackUrl="~/secure/createdTrips.aspx" meta:resourcekey="imgbtnCreatedTrips" runat="server" />
            <asp:ImageButton ID="ImageButton1" ImageUrl="~/master/resourcesNew/img/j_trip_ico.png" PostBackUrl="~/secure/JoinedTrip.aspx" meta:resourcekey="joinedTrip" runat="server" />
            <asp:ImageButton ID="dt_message" ImageUrl="~/master/resourcesNew/img/ico_message.png" PostBackUrl="~/secure/messages.aspx" meta:resourcekey="imgbtnMessage" runat="server" />
            <asp:ImageButton ID="bt_friends" ImageUrl= "~/master/resourcesNew/img/ico_friends.png" PostBackUrl="~/secure/MyFriends.aspx" meta:resourceKey="imgbtFriends" runat="server" /><br />
            <asp:ImageButton ID="bt_feedback" ImageUrl="~/master/resourcesNew/img/bt_feedback.png" PostBackUrl="~/secure/SetFeedback.aspx" meta:resourcekey="imgbtsetFeedback" Visible="false" runat="server" />
            
          </div>
        </div>
        <div class="panel_controls_separator"></div>
        
        <asp:Panel ID="panel_messages" runat="server" Visible="false">
        <div class="panel_controls_line">
            
            <div id="msg_messages">
                 <asp:label ID="message_p1"  CssClass="label_title" runat="server" meta:resourcekey="lbl_msg_messages"></asp:label>
                 <asp:HyperLink ID="count_message" CssClass="label_title" runat="server" NavigateUrl="~/secure/messages.aspx"></asp:HyperLink>
                 <asp:label ID="message_p2"  CssClass="label_title" runat="server" meta:resourcekey="lbl_messages"></asp:label>
           </div>
        </div>
        <div class="panel_controls_separator"></div>
        
        </asp:Panel>
        
        
        <asp:Panel ID="panel_feedback" runat="server" Visible="false">
        <div class="panel_controls_line">
            
            <div id="Div1">
                 <asp:HyperLink ID="hyperFeedback" runat="server" 
                    CssClass="label_title" NavigateUrl="~/secure/SetFeedback.aspx"
                    meta:resourcekey="HyperFeebackResource"></asp:HyperLink></div>
            </div>
        <div class="panel_controls_separator"></div>
        
        </asp:Panel>
        
        
        <div class="panel_controls_line">
                <asp:HyperLink ID="hyperUserProfile" runat="server"  Text="Profile" 
                    CssClass="label_title" NavigateUrl="~/secure/userProfile.aspx" 
                    meta:resourcekey="hyperUserProfileResource" ></asp:HyperLink><br />
                <asp:HyperLink ID="hyperMessages" CssClass="label_title" Text="Messages" NavigateUrl="~/secure/messages.aspx" meta:resourcekey="hyperMessagesResource" runat="server"></asp:HyperLink><br />
                <asp:HyperLink ID="hyperFriends" CssClass="label_title" NavigateUrl="~/secure/MyFriends.aspx" meta:resourcekey="hyperFriendsResource" runat="server">HyperLink</asp:HyperLink>
                
            <% if (Page.User.IsInRole("Administrators")){%>
                        <br />
                        <asp:HyperLink ID="hyperAdmin" runat="server" 
                NavigateUrl="~/roles/AdminPage.aspx" CssClass="label_title" 
                meta:resourcekey="HyperAdminResource">Admin</asp:HyperLink>
                    <%} %>
                    
         </div>
        <div class="panel_controls_separator"></div>
        
        <div class="panel_controls_line">     
                <asp:HyperLink ID="hyperNewTrip" runat="server"  Text="New trip" 
                    CssClass="label_title" NavigateUrl="~/secure/createNewTrip.aspx" 
                    meta:resourcekey="HyperNewTripResource"></asp:HyperLink> <br />
                <asp:HyperLink ID="hyperTripDetails" runat="server"  Text="Created Trips" 
                    CssClass="label_title" NavigateUrl="~/secure/createdTrips.aspx" 
                    meta:resourcekey="HyperTripDetailsResource"></asp:HyperLink><br />
                <asp:HyperLink ID="joinedtrips" runat="server"  Text="Joined Trips" 
                    CssClass="label_title" NavigateUrl="~/secure/JoinedTrip.aspx" 
                    meta:resourcekey="joinedTriplink"></asp:HyperLink><br />
               
        </div>
 
        <div id="panel_controls_footer"></div>
        
    </div>
</asp:Content>
